<script setup>
import { ref } from 'vue';
import emitter from '@/plugins/Bus';
const str = ref('这是A组件的内容');
const btn = () => {
  emitter.emit('on-fn', str);
}
</script>

<template>
  <div>
    <h1>这是A组件</h1>
    <button @click="btn">点击</button>
  </div>
</template>

<style scoped>

</style>